<div class="row-fluid">
    <div class="navbar no-margin">
        <div class="navbar-inner">
            <ul class="breadcrumb">
                <i class="icon-chevron-left hide-sidebar"><a href='#' title="Hide Sidebar" rel='tooltip'>&nbsp;</a></i>
                <i class="icon-chevron-right show-sidebar" style="display:none;"><a href='#' title="Show Sidebar"
                                                                                    rel='tooltip'>&nbsp;</a></i>
                <li>
                    <a href="#/onduty">首页</a>
                </li>
                <li>
                    <a href="#/sre/config/olap_config/">实时OLAP配置列表</a>
                </li>
                <li class="active">OLAP配置添加</li>
            </ul>
        </div>
    </div>
</div>

<div class="container-fluid">

    <div class="row">
        <div class="col-sm-12 col-md-12 main">
            <div class="col-md-6 col-md-offset-3">
<!--                <form name="form" ng-keydown="if(event.keyCode==13) return false;" ng-submit="form.$valid&&olapConfigAdd()" novalidate>-->
                <form name="form" novalidate>
                    <div class="form-group"
                         ng-class="{'has-error':form.groupName.$error.required,'has-success':!form.groupName.$error.required}">
                        <label style="padding: 0 0 5px">执行器分组</label>
                        <!--                        <input type="text" class="form-control" name="resolvegroupId" ng-model="vm.p.resolvegroupId"/>-->
                        <input type="text" class="form-control" name="groupName" ng-model="vm.p.groupName" required/>
                        <span ng-show="form.groupName.$error.required" class="help-block">请填写执行器分组</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.calculateType.$error.required,'has-success':!form.calculateType.$error.required}">
                        <label style="padding: 0 0 5px">计算模式</label>
                        <!--                        <input type="text" class="form-control" name="ctiId" ng-model="vm.p.ctiId"/>-->
                        <select required name="calculateType" ng-model="vm.p.calculateType" class="form-control">
                            <option>window</option>
                            <option>current</option>
                        </select>
                        <span ng-show="form.calculateType.$error.required" class="help-block">请选择计算模式</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.saveType.$error.required,'has-success':!form.saveType.$error.required}">
                        <label style="padding: 0 0 5px">数据结果更新模式</label>
                        <select required name="saveType" ng-model="vm.p.saveType" class="form-control">
                            <option>add</option>
                            <option>cover</option>
                        </select>
                        <span ng-show="form.saveType.$error.required" class="help-block">请选择数据结果更新模式</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.dimensions.$error.required,'has-success':!form.dimensions.$error.required}">
                        <label style="padding: 0 0 5px">维度名称</label>
<!--                        <input type="text" class="form-control" name="dimensions" ng-model="vm.p.dimensions" required/>-->
                        <input id="dimensions" type="text" class="form-control" name="dimensions" ng-model="vm.p.dimensions" data-role="tagsinput" required/>
<!--                        <input type="text" value="Amsterdam,Washington,Sydney,Beijing,Cairo" data-role="tagsinput">-->

                        <span ng-show="form.dimensions.$error.required" class="help-block">请填写维度名称</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.colkey.$error.required,'has-success':!form.colkey.$error.required}">
                        <label style="padding: 0 0 5px">wtable的colkey</label>
                        <input type="text" class="form-control" name="colkey" ng-model="vm.p.colkey" required/>
                        <span ng-show="form.colkey.$error.required" class="help-block">请填写wtable的colkey</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.sql.$error.required,'has-success':!form.sql.$error.required}">
                        <label style="padding: 0 0 5px">sql</label>
                        <textarea class="form-control" name="sql" ng-model="vm.p.sql" style="height:200px"
                                   required></textarea>
                        <span ng-show="form.description.$error.required" class="help-block">请填写sql</span>
<!--                        <span ng-show="form.description.$error.pattern" class="help-block">请填写sql</span>-->
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.indicators.$error.required,'has-success':!form.indicators.$error.required}">
                        <label style="padding: 0 0 5px">wtable的特征（指标）名称</label>
                        <!--                        <input type="text" class="form-control" name="dimensions" ng-model="vm.p.dimensions" required/>-->
                        <input id="indicators" type="text" class="form-control" name="indicators" ng-model="vm.p.indicators" data-role="tagsinput" required/>
                        <!--                        <input type="text" value="Amsterdam,Washington,Sydney,Beijing,Cairo" data-role="tagsinput">-->

                        <span ng-show="form.indicators.$error.required" class="help-block">请填写wtable的特征（指标）名称</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.groupIndex.$error.required,'has-success':!form.groupIndex.$error.required}">
                        <label style="padding: 0 0 5px">组内序号</label>
                        <input type="number" class="form-control" name="groupIndex" ng-model="vm.p.index" required/>
                        <span ng-show="form.groupIndex.$error.required" class="help-block">请填写组内序号</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.timeInterval.$error.required,'has-success':!form.timeInterval.$error.required}">
                        <label style="padding: 0 0 5px">窗口大小（秒）</label>
                        <input type="number" class="form-control" name="timeInterval" ng-model="vm.p.timeInterval"
                               required/>
                        <span ng-show="form.timeInterval.$error.required" class="help-block">请填写窗口大小（秒）</span>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':form.timeGran.$error.required,'has-success':!form.timeGran.$error.required}">
                        <label style="padding: 0 0 5px">窗口结束时间（分）</label>
                        <input type="number" class="form-control" name="timeGran"
                               ng-model="vm.p.timeGran" required/>
                        <span ng-show="form.timeGran.$error.required" class="help-block">请填写窗口结束时间</span>
                    </div>

                    <div class="form-group">
                        <input class="btn btn-primary" ng-class="{'disabled':!form.$valid}"
                               type="button" value="确定" ng-click="form.$valid&&olapConfigAdd()"/>
                        <a href="#/sre/config/olap_config/" class="btn btn-default">返回</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div><!--/.container-->
<script type="text/javascript" charset="UTF-8" src="../lib/bootstrap/js/bootstrap-tagsinput.js"></script>
<script type="text/javascript" charset="UTF-8" src="../lib/bootstrap/js/bootstrap-tagsinput-angular.js"></script>